//import okhttp3.OkHttpClient;
//import okhttp3.Request;
//import okhttp3.Response;
//
//import javax.net.ssl.SSLContext;
//import javax.net.ssl.SSLSocketFactory;
//import javax.net.ssl.TrustManager;
//import javax.net.ssl.X509TrustManager;
//import java.io.InputStream;
//import java.security.GeneralSecurityException;
//
//public class CustomTrust {
//    private final OkHttpClient client;
//
//    public CustomTrust() {
//        X509TrustManager trustManager;
//        SSLSocketFactory sslSocketFactory;
//        try {
//            trustManager = trustManagerForCertificates(trustedCertificatesInputStream());
//            SSLContext sslContext = SSLContext.getInstance("TLS");
//            sslContext.init(null, new TrustManager[] { trustManager }, null);
//            sslSocketFactory = sslContext.getSocketFactory();
//        } catch (GeneralSecurityException e) {
//            throw new RuntimeException(e);
//        }
//
//        client = new OkHttpClient.Builder()
//                .sslSocketFactory(sslSocketFactory, trustManager)
//                .build();
//    }
//
//    public void run() throws Exception {
//        Request request = new Request.Builder()
//                .url("https://publicobject.com/helloworld.txt")
//                .build();
//
//        Response response = client.newCall(request).execute();
//        System.out.println(response.body().string());
//    }
//
//    private InputStream trustedCertificatesInputStream() {
////    ... // Full source omitted. See sample.
//        return null;
//    }
//
//    public SSLContext sslContextForTrustedCertificates(InputStream in) {
////    ... // Full source omitted. See sample.
//        return null;
//    }
//}
